#!/bin/bash

DIR="$(dirname "$0")"

chmod 777 $DIR/setuptool_dk.sh

if [ "$1" = "modify" ];then 
  #echo flashrom_cmd: $flashrom_cmd
  # $0 $1 $2 $3 
  echo "$1 start"
  bash $DIR/setuptool_dk.sh rom.bin export  $4 $5 $6 $7 $8
  $DIR/config_modify_tool ./config/config "$2" "$3"
  bash $DIR/setuptool_dk.sh rom.bin import  $4 $5 $6 $7 $8
  exit 0
fi
bash  $DIR/setuptool_dk.sh rom.bin $*
exit $?